package org.xiaov.codeautocreator.config;

import com.baomidou.mybatisplus.annotation.DbType;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.xiaov.codeautocreator.exception.CodeAutoBizException;
import org.xiaov.codeautocreator.mapper.AutoCodeMapper;

import javax.annotation.Resource;

/**
 * <p>
 * 描述：
 * </p>
 *
 * @author xiaovcloud
 * @since 2021/9/12 20:30
 */
@SpringBootConfiguration
public class DataSourceConfig {

//    @Value("${spring.datasource.druid.db-type:mysql}")
//    String dbType;
//
//    @Resource
//    private AutoCodeMapper autoCodeMapper;
//
//
//    @Bean
//    @Primary
//    public AutoCodeMapper getGeneratorDao() {
//        if (DbType.MYSQL.name().equalsIgnoreCase(dbType)) {
//            return mySQLGeneratorMapper;
//        } else {
//            throw new CodeAutoBizException("不支持当前数据库：" + dbType);
//        }
//    }

}
